package com.Ritany3.subject.application.controller;



import com.Ritany3.subject.common.entity.PageResult;
import com.Ritany3.subject.infra.basic.entity.SubjectInfoEs;
import com.Ritany3.subject.infra.basic.service.SubjectEsService;
import com.Ritany3.subject.infra.entity.UserInfo;
import com.Ritany3.subject.infra.rpc.UserRpc;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/subject/category")
@Slf4j
public class TestFeginController {
    @Resource
    private UserRpc userRpc;
    @Resource
    private SubjectEsService subjectEsService;

    @GetMapping("testFegin")
    public void testFegin(){
        UserInfo userInfo = userRpc.getUserInfo("Ritany3");
        log.info("testFegin.userInfo:{}",userInfo);
    }

//    @PostMapping("querySubjectByKeyword")
//    public void querySubjectByKeyword(){
//        SubjectInfoEs subjectInfoEs = new SubjectInfoEs();
//        subjectInfoEs.setKeyWord("redis");
//        PageResult<SubjectInfoEs> pageResult = subjectEsService.querySubjectList(subjectInfoEs);
//
//        log.info("querySubjectByKeyword:{}", JSON.toJSONString(pageResult));
//
//    }

}
